$('#politico_nome').typeahead({
	minLength: 1,
    source: function(query, process) {
    	objects = [];
    	map = {};
    	
    	$('#politico_id').val('');
        
    	return $.post('/admin/politico/listar/' + query, {nome : query}, function(data) {
            $.each(data, function(i, object) {
            	map[object.nome] = object;
            	objects.push(object.nome);
            });
            return process(objects);
        }, 'json');
    },
    updater: function(item) {
    	$('#politico_id').val(map[item].id);
    	return item;
    }

});